<template>
  <view class="my-search-container" :style="{'background-color': bgcolor}" @click="handle">
    <view class="my-search-box" :style="{'border-radius': radius + 'rpx'}">
      <!-- 使用uni-ui提供的组件 -->
      <uni-icons type="search" size="17"></uni-icons>
      <text class="placeholder">搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name:"my-search",
    props: {
      bgcolor: {
        type: String,
        default: "#c00000"
      },
      radius: {
        type: Number,
        default: 36 // rpx
      }
    },
    data() {
      return {
        
      };
    },
    methods:{
      handle(){
        this.$emit('click');
      }
    }
  }
</script>

<style lang="scss">
.my-search-container{
  height: 100rpx;
  // background-color: #c00000;
  display: flex;
  align-items: center;
  padding: 0 20rpx;
  .my-search-box{
    height: 72rpx;
    background-color: #ffffff;
    // border-radius: 36rpx;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    .placeholder{
      font-size: 30rpx;
      margin-left: 10rpx;
    }
  }
}
</style>
